<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>欢迎注册</title>

    <!-- <link href="css/register.css" rel="stylesheet"> -->

    <link rel="stylesheet" href="../../style/login/register.css">

    <script type="text/javascript" src="../../plugins/axios/axios.js"
            ￼
    ></script>

    <script type="text/javascript" src="../../plugins/vue/vue.js"
            ￼
    ></script>

    <script type="text/javascript" src="../../plugins/jQuery/jquery-3.6.0.js"
            ￼
    ></script>

    <script type="text/javascript" src="../../plugins/layer-master/dist/layer.js"
            ￼
    ></script>


    <link rel="stylesheet" href="../../plugins/element-ui/index.css">

    <!-- 引入组件库 -->

    <script src="../../plugins/element-ui/index.js"
            ￼
    ></script>

</head>

<body>

<div id="app">

    <div class="form-div">

        <div class="reg-content">

            <h1>欢迎注册</h1>

            <span>已有帐号？</span> <a href="../login/login.html">登录</a>

        </div>

        <form id="reg-form" action="#" method="post">


            <table>

                <tr>

                    <td>用户名</td>

                    <td class="inputs">

                        <input name="cus_name" type="text" id="cus_name" v-model="cus_name">

                    </td>

                </tr>


                <tr>

                    <td>密码</td>

                    <td class="inputs">

                        <input name="cus_password" type="password" id="cus_password" v-model="cus_password">

                    </td>

                </tr>


                <tr>

                    <td>手机号</td>

                    <td class="inputs">

                        <input name="cus_phone" type="text" id="cus_phone" v-model="cus_phone">

                    </td>

                </tr>

            </table>

            <div class="buttons">

                <input value="注 册" type="button" id="reg_btn" @click="registerIn">

            </div>

            <br class="clear">

        </form>

    </div>

</div>



</body>

</html>

<script>

    new Vue({

        el: '#app',

        data:{

            cus_name: '',

            cus_password: '',

            cus_phone: '',

        },

        methods: {

            registerIn(){

                axios({

                    url: 'http://localhost:8888/customer/add',

                    method: 'get',

// 传递的参数

                    params:{

                        cus_name:this.cus_name,

                        cus_password:this.cus_password,

                        cus_phone:this.cus_phone

                    }

                }).then(resp=>{

// 跳转

                    location.href = '../login/login.html';

                })

            }

        }

    })

</script>